package com.example.crm.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.crm.entity.SystemConfig;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * 系统配置Mapper接口
 */
@Mapper
public interface SystemConfigMapper extends BaseMapper<SystemConfig> {
    
    /**
     * 根据分组名获取配置列表
     */
    @Select("SELECT * FROM sys_config WHERE group_name = #{groupName}")
    List<SystemConfig> selectByGroupName(@Param("groupName") String groupName);
    
    /**
     * 根据配置键获取配置值
     */
    @Select("SELECT config_value FROM sys_config WHERE config_key = #{configKey}")
    String getConfigValueByKey(@Param("configKey") String configKey);
} 